
<input id="ctx" type="text" value="/weixt" style="display:none;" />
<input id="commonUrl_loadingPage" type="hidden" value="/weixt/mobile/loading_page?orgcode=10098&campusid=1089&userid=470242&fromusername=oQLH9jkdQHWLKAxj9TbEszl5cua8&xx_type=1" />
<input id="commonUrl_loadingData" type="hidden" value="/weixt/mobile/loading_data?orgcode=10098&campusid=1089&userid=470242&fromusername=oQLH9jkdQHWLKAxj9TbEszl5cua8&xx_type=1" />
<input id="stuid" type="hidden" value="0" />
<input id="appIsPreview" type="hidden" value="false" />
<input id="appIsOpen" type="hidden" value="true" />

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>班级圈</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/jquery-emoji.css?v=4.9" />
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/greenStyle.css?v=4.90120" />
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/comment.css?v=4.9" />
<link type="text/css" rel="stylesheet" href="{OSSURL}public/mobile/css/bjqCss.css?v=4.9">
{php echo register_jssdk();}
<script type="text/javascript" src="{MODULE_URL}public/mobile/js/jquery-1.11.3.min.js?v=4.9"></script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript" src="{OSSURL}public/mobile/js/PromptBoxUtil.js?v=4.80309"></script>
<script type="text/javascript" src="{OSSURL}public/mobile/js/mBjqForm.js?v=4.9"></script>
<script type="text/javascript" src="{OSSURL}public/mobile/js/jquery.emoji1.js?v=4.8"></script>
</head>
<body>
	

<input id="commonUrl_loadingData" type="hidden" value="/weixt/mobile/loading_data?orgcode=10098&campusid=1089&userid=470242&fromusername=oQLH9jkdQHWLKAxj9TbEszl5cua8&xx_type=1" />
<input id="appid" type="hidden" value="30200" />
<input id="appIsOpen" type="hidden" value="true" />
<input id="fromusername" type="hidden" value="oQLH9jkdQHWLKAxj9TbEszl5cua8" />
<input id="wdbb_stuid" type="hidden" value="0" />
<input id="appIsPreview" type="hidden" value="false" />
<input id="usertype" type="hidden" value="1" />
<input id="mobileSessionUserItem" type="hidden" value="470242" />
<input id="isopen" type="hidden" value="{$school['isopen']}" />

<div id="BlackBg" class="BlackBg"></div>
<div id="titlebar" class="header mainColor">
	<div class="l"><a class="backOff" href="javascript:history.go(-1);"></a></div>
	<div class="m">
		<span style="font-size: 18px">发布班级圈</span>   
	</div>
</div>
<div id="titlebar_bg" class="_header"></div>

	<div id="fullbg" class="fullbg"></div>
	<div class="xcBody">
		<div class="xcShareBox">
			<div class="r">
				<div class="sendCon pr">
					<textarea id="content" name="content" cols="" rows="" class="sInput f15" placeholder="说点什么....."></textarea>
				</div>
				<div style="padding:10px 2%;border-bottom:1px solid #e9e9e9;">
					<img id="imageClose" class="showImageBox" alt="插入图片" src="{OSSURL}public/mobile/img/imageClose.png" width="30" height="30" onclick="showBox('image')">
					<img id="imageOpen" class="showImageBox" alt="插入图片" src="{OSSURL}public/mobile/img/imageOpen.png" width="30" height="30" onclick="showBox('image')">		
				</div>
				<input type="hidden" id="weixinMediaId" name="weixinMediaId" value="">
				<input type="hidden" id="vedioUrl" name="vedioUrl" value="">
				<div id="imageBox" class="imageBox">
				</div>

				<div id="pic" class="pic parent">
					<input type="hidden" id="sendtype" name="sendtype" value="2">				
					<!-- 光海活动 -->
					<input type="hidden" id="isGhActivity" name="isGhActivity" value="">
					<input type="hidden" id="ghActivityThemeParentid" name="ghActivityThemeParentid" value="">		
				</div>
					<div class="sendParam sendParam_wot pr" onclick="showSelectBox('bjList')">
			            <span class="locationCon address f15" closestatus="0"><i class="iconloc bj_icon_background-position float_left"></i>班级</span>
			            <span class="sendSelectParamOperBtn pa address f15 c9" closestatus="0" id="bjListShow"></span>
		            	<input id="bjListValue" name="bjListValue" type="hidden"/>
			            <span class="sendParamOperBtn pa address f15 c9" closestatus="0"><i class="iconloc fx_icon_background-position float_left"></i></span>
	        		</div>
				<div class="blackBg" onclick="closeBox();"></div>
				<div class="selectList">
					<div class="double" id="bjList">
						<div class="checkAll" onclick="isCheckAll(this);">
							<span name="checkAll" class="le">全选</span>
							<span class="ri"><img alt="check" src="{OSSURL}public/mobile/img/check.png" /></span>
						</div>
						<ul>
							{if !empty($bjid1)}<li onclick="isCheck(this);"><span name="checkName" class="le">{$name1}</span><span class="ri"><img alt="check" src="{OSSURL}public/mobile/img/check.png" /></span><input type=hidden name="check" value="{$bjid1}" /></li>{/if}
							{if !empty($bjid2)}<li onclick="isCheck(this);"><span name="checkName" class="le">{$name2}</span><span class="ri"><img alt="check" src="{OSSURL}public/mobile/img/check.png" /></span><input type=hidden name="check" value="{$bjid2}" /></li>{/if}
							{if !empty($bjid3)}<li onclick="isCheck(this);"><span name="checkName" class="le">{$name3}</span><span class="ri"><img alt="check" src="{OSSURL}public/mobile/img/check.png" /></span><input type=hidden name="check" value="{$bjid3}" /></li>{/if}							
						</ul>
						<div class="btnBox"></div>
						<div class="btn">
							<div class="box">
								<span class="ok" onclick="saveChecked('bjList');">确认</span>
							</div>
							<div class="box">
								<span onclick="closeBox();">取消</span>
							</div>
						</div>
					</div>
					<div class="double" id="stuList">
						<div class="checkAll" onclick="isCheckAll(this);">
							<span name="checkAll" class="le">全选</span>
							<span class="ri"><img alt="check" src="{OSSURL}public/mobile/img/check.png" /></span>
						</div>
						<ul>
							
						</ul>
						<div class="btnBox"></div>
						<div class="btn">
							<div class="box">
								<span class="ok" onclick="saveChecked('stuList');">确认</span>
							</div>
							<div class="box">
								<span onclick="closeBox();">取消</span>
							</div>
						</div>
					</div>
					
					<div class="single" id="isopen">
						<ul>
							<li class="selected" onclick="isSelect(this);"><span class="le">是</span><input type=hidden name="select" value="1" /></li>
							<li onclick="isSelect(this);"><span class="le">否</span><input type=hidden name="select" value="0" /></li>
						</ul>
					</div>
				</div>
				<div class="sendInfo wot pr">
              		<a href="javascript:sendPhoto();" class="sendBtn brSmall f15 db c2" >发布到班级圈</a>
              		<a href="javascript:cancel();" class="sendBtn cancelNewBtn brSmall f15 db c2" >取消</a>
				</div>
			</div>
    		<div class="cl"></div>
		</div>
		
	</div>
<script type="text/javascript">
/**
 * 课堂动态新增页面
 */
var PB = new PromptBox();
var sendtype=$("#sendtype").val();
var isopen=$("#isopen").val();
function cancel(){
	history.go(-1);
}

function sendPhoto(){
	var content = $("#content").val();

	if(content==''){
		PB.prompt("文字内容不能为空");
		return false;
	}
	var bjids =  $("#bjListValue").val(); 
	if(bjids == undefined || bjids == null || bjids == "" ){
		PB.prompt("请选择班级！");
		return false;
	}
	if(sendtype == 1 || sendtype==3){
		stuids =  $("#stuListValue").val();
		//isopenValue =  $("#isopenValue").val();
		if(stuids == undefined || stuids == null || stuids == "" ){
			PB.prompt("请选择学生！");
			return;
		}	
    
		var stuidsAndBjidsArray = stuids.split(',');
		var bjidsArray = new Array();
		var stuidsArray = new Array();
		for(var i =0;i<stuidsAndBjidsArray.length;i++){
			var bjidAndStuid = stuidsAndBjidsArray[i].split('_');
			bjidsArray.push(bjidAndStuid[0]);
			stuidsArray.push(bjidAndStuid[1]);
		}
		
		bjids = bjidsArray.join(',');
		stuids = stuidsArray.join(',');	
	}
	var photoUrls = images.serverId.join(',');
	
	if (confirm("确定发布?")) {
		PB.prompt("信息发布中，请稍等~","forever");
		var submitData = {
			weid:"{$weid}",
			bjids : bjids,
			openid : "{$openid}",
			schoolid : "{$schoolid}",
			content : content,
			uid:"{$fan['uid']}",
			isopen:isopen,
			shername:"{$teachers['tname']}老师",
			photoUrls : photoUrls,
		};
	    $.post("{php echo $this->createMobileUrl('bjqajax',array('op'=>'fabu'))}",submitData,function(data){

            if(data.result){
                PB.prompt(data.msg);
				history.go(-1);
            }else{
				PB.prompt(data.msg);
            }
		},'json'); 		
	}
}
</script>	
</body>
</html>